
import { login, callRoel } from "../../services/login"
export default {

  namespace: 'login',

  state: {},

  effects: {
    *loginInfo({ payload }, { call, put }) {
       let logins = yield login(payload)
       if(logins.statusCode == 200){
        return yield callRoel()
       }else{
        return logins
       }
    },

    *fetch({ payload }, { call, put }) {  // eslint-disable-line
      yield put({ type: 'save' });
    },
  },

  reducers: {
    save(state, action) {
      return { ...state, ...action.payload };
    },
  },

};
